package com.xbongbong.rule.rules;

import com.xbongbong.paas.toolbox.exception.XbbException;

/**
 * 规则触发逻辑执行接口
 * 具体应由调用方实现
 <pre class="code">
 *
 * public class MyAction implements XbbAction<T> {
 *
 *     &#064;Override
 *     public void action(T t) {
 *          // do something
 *     }
 *
 * }</pre>
 * OR
 <pre class="code">
 *  XbbRule&lt;JSONObject&gt; xbbRule = new XbbRule<>();
 *  xbbRule.setAction() {
 *
 *         new XbbAction &lt;JSONObject&gt; () {
 *              &#064;Override
 *              public void action(JSONObject jsonObject) {
 *                  // do something
 *              }
 *         });
 *  }
 *  </pre>
 *
 * @author zheng.li
 * @param <T> type of Fact value
 */
@SuppressWarnings("AlibabaRemoveCommentedCode")
public interface XbbAction<T> {

    /**
     * 规则的执行逻辑
     * @param t fact实体
     */
    void action(T t) throws Exception;

}
